﻿@model SchoolCommunicationSystem.Models.TeacherViewModels
@{
    ViewBag.Title = "Thông tin phụ huynh";
    Layout = "~/Views/Shared/_TeacherLayout.cshtml";
}
@Scripts.Render("~/bundles/tablesorter")
@Scripts.Render("~/bundles/tablesorterpaging")
<script type="text/javascript">
    $(function () {

        $("table")
            .tablesorter({
                widthFixed: true, widgets: ['zebra']
            })
            .tablesorterPager({ container: $("#pagersorter") });
    });
</script>
<div id="page-heading">
    <h1>Thông Tin Liên Hệ</h1>
</div>
<div class="container">
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h4>Thông tin phụ huynh</h4>
                </div>
                <div class="panel-body">
                    <h2>Lớp: @Model.className</h2>
                    <br />
                    <div class="module_contentresult">
                        <table class="tablesorter">
                            <thead>
                                <tr>
                                    <th>Mã số học sinh</th>
                                    <th>Họ tên học sinh</th>
                                    <th>Lớp</th>
                                    <th>Họ tên phụ huynh</th>
                                    <th>giới tính</th>
                                    <th>Điện thoại di động</th>
                                    <th>Điện thoại nhà riêng</th>
                                    <th>Gửi tin nhắn</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach (var item in Model.learners)
                                {
                                    <tr>
                                        <td>@item.learnerID</td>
                                        <td>@item.firstName @item.lastName</td>
                                        <td>@item.Class.ClassInSchoolYears.FirstOrDefault().className</td>
                                        <td>@item.Parent.parentName</td>
                                        @if (item.Parent.gender == "M")
                                        {
                                            <td>Nam</td>
                                        }
                                        else
                                        {
                                            <td>Nữ</td>
                                        }
                                        <td>@item.Parent.mobile</td>
                                        <td>@item.Parent.tel</td>
                                        <td>@Html.ActionLink((string)item.Parent.parentName, "Create", "PrivateMessage", 
                                                                new { id = item.Parent.userID }, new { a = "" })</td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                        <div id="pagersorter" class="pagersorter" style="clear: both;">
                            <form>
                                <img src="../../Content/images/first.png" class="first" />
                                <img src="../../Content/images/prev.png" class="prev" />
                                <input type="text" class="pagedisplay" />
                                <img src="../../Content/images/next.png" class="next" />
                                <img src="../../Content/images/last.png" class="last" />
                                <select class="pagesize">
                                    <option selected="selected" value="10">10</option>
                                    <option value="20">20</option>
                                    <option value="30">30</option>
                                    <option value="40">40</option>
                                </select>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
